package com.yonyou.cyxdms.basedata.client.feign;

import com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse;
import com.yonyou.cyxdms.basedata.client.domains.vo.*;
import com.yonyou.cyxdms.basedata.client.dto.CmsApp04;
import com.yonyou.cyxdms.basedata.client.dto.CmsApp04QueryDto;
import com.yonyou.cyxdms.basedata.client.dto.RegionConditionDTO;
import com.yonyou.cyxdms.basedata.client.dto.VsProductDlrVO;
import com.yonyou.cyxdms.basedata.client.dto.code.CodeDTO;
import com.yonyou.cyxdms.basedata.client.dto.option.VsOptionDTO;
import com.yonyou.cyxdms.basedata.client.dto.product.VehicleInfoDTO;
import com.yonyou.cyxdms.basedata.client.dto.wholesales.PlanTemplateDTO;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * feign
 *
 * @author: renwd
 * @since: 2018/11/27
 * @version:1.0 Copyright: Copyright (c) 2018
 */

@FeignClient(value = "sysbasedata-service")
public interface BaseDataCommonClient {

    /**
     * 查询品牌信息
     *
     * @param queryCondition 查询条件
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.BrandCacheVO>
     * @author renwd
     * @since 2018/12/11
     */
    @GetMapping(value = "/brand/queryBrandByCondition")
    RestResultResponse<List<BrandCacheVO>> queryBrandBySql(@RequestParam Map<String, Object> queryCondition);

    /**
     * 查询品牌信息
     *
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.BrandCacheVO>
     * @author renwd
     * @since 2018/12/11
     */
    @GetMapping(value = "/brand/getBrand")
    RestResultResponse<List<BrandCacheVO>> getBrand();

    /**
     * 查询车系信息
     *
     * @param queryCondition 查询条件
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.SeriesCacheVO>
     * @author renwd
     * @since 2018/12/11
     */
    @GetMapping(value = "/series/querySeriesByCondition")
    RestResultResponse<List<SeriesCacheVO>> querySeriesBySql(@RequestParam Map<String, Object> queryCondition);

    /**
     * 查询品牌下的车系信息
     */
    @GetMapping(value = "/series/allSeries")
    RestResultResponse<List<SeriesCacheVO>> allSeries();

    /**
     * 查询品牌下的车系信息
     */
    @GetMapping(value = "/model/allModel")
    RestResultResponse<List<ModelCacheVO>> allModel();

    /**
     * 查询车型信息
     *
     * @param queryCondition 查询条件
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.ModelCacheVO>
     * @author renwd
     * @since 2018/12/11
     */
    @GetMapping(value = "/model/queryModelByCondition")
    RestResultResponse<List<ModelCacheVO>> queryModelBySql(@RequestParam Map<String, Object> queryCondition);

    /**
     * 查询配置信息
     *
     * @param queryCondition 查询条件
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.PackageCacheVO>
     * @author renwd
     * @since 2018/12/11
     */
    @GetMapping(value = "/package/queryPackageByCondition")
    RestResultResponse<List<PackageCacheVO>> queryPackageBySql(@RequestParam Map<String, Object> queryCondition);

    /**
     * 查询选装信息
     *
     */
    @GetMapping(value = "/option/vsOption/queryOptionByCondition")
    RestResultResponse<List<VsOptionVO>> queryOptionByCondition(@RequestParam Map<String, Object> queryCondition);

    /**
     * 查询颜色信息
     *
     * @param queryCondition
     * @return com.yonyou.ccss.framework.bean.dto.framework.RestResultResponse<java.util.List < com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.ColorCacheVO>>
     * @author renwd
     * @since 2018/12/18
     */
    @GetMapping(value = "/color/queryColorByCondition")
    RestResultResponse<List<ColorCacheVO>> queryColorBySql(@RequestParam Map<String, Object> queryCondition);

    @GetMapping(value = "/color/queryColorByConditionCMS")
    RestResultResponse<List<ColorCacheCMSVO>> queryColorBySqlCMS(@RequestParam Map<String, Object> queryByMap);

    /**
     * 查询TCCODE
     *
     * @param queryCondition 查询条件
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CodeVO>
     * @author renwd
     * @since 2018/12/11
     */
    @GetMapping(value = "/code/queryTcCodeByType")
    RestResultResponse<List<CodeVO>> queryCodeBySql(@RequestParam Map<String, Object> queryCondition);

    /**
     * 查询所有TCCODE
     *
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CodeVO>
     * @author renwd
     * @since 2018/12/11
     */
    @GetMapping(value = "/code/queryTcCode")
    RestResultResponse<List<CodeVO>> queryCode(@RequestParam("appId") String appId);

    /**
     * tc_code 新增
     *
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CodeVO>
     * @author chengliang
     * @since 2018/12/11
     */
    @PostMapping(value = "/code")
    RestResultResponse<Map<String, Object>> insert(@RequestBody CodeDTO codeDTO);

    /**
     * tc_code 修改
     *
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CodeVO>
     * @author chengliang
     * @since 2018/12/11
     */
    @PutMapping(value = "/code/update")
    RestResultResponse<Map<String, Object>> update(@RequestBody CodeDTO codeDTO);

    /**
     * @description：根据车系名称模糊查询
     * @author ：quankk
     * @date ：Created in 2019/1/14 18:35
     * @modified By：
     */
    @GetMapping(value = "/series/seriesBySeriesName")
    RestResultResponse<List<SeriesCacheVO>> seriesBySeriesName(@RequestParam("appId") String appId, @RequestParam(
            "seriesName") String seriesName);


    /**
     * 查询所有省市区数据
     *
     * @param
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.region.RegionVO>
     * @author dengqiang
     * @since 2019/8/21
     */
    @GetMapping(value = "/region/listAllData")
    RestResultResponse<List<RegionVO>> listAllData();
    
    /**
     * 查询所有省
     *
     * @param
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.region.RegionVO>
     * @author wy
     * @since 2020/2/24
     */
    @GetMapping(value = "/region/listAllProvice")
    RestResultResponse<List<RegionVO>> listAllProvice();


    /**
     * 根据id查询车辆主数据
     *
     * @param id
     * @return com.yonyou.cyxdms.basedata.service.vo.productinfo.VsMasterInfoVO
     * @author dengqiang
     * @since 2019/8/23
     */
    @GetMapping("/vehicleMasterInfo/{id}")
    RestResultResponse<VsMasterInfoVO> queryProductInfoById(@PathVariable("id") Long id);

    /**
     * TCC获取车辆主数据
     *
     * @author ysj
     * @date 2019/11/19
     * @param id
     * @return
     */
    @GetMapping("/vehicleMasterInfo/queryTccProductInfoById/{id}")
    RestResultResponse<VsMasterInfoVO> queryTccProductInfoById(@PathVariable("id") Long id);

    /**
     * @description：根据品牌id查询车系
     * @author ：maxingjain
     * @date ：Created in 2019/1/14 18:35
     * @modified By：
     */
    @GetMapping(value = "/series/getSeriesByBrandId")
    RestResultResponse<List<SeriesCacheVO>> getSeriesByBrandId(@RequestParam("brandId") String brandId);

    /**
     * 根据条件查询品牌，车系，车型，配置id列表
     *
     * @param searchCondition
     * @return com.yonyou.cyxdms.basedata.service.vo.VehicleVO
     * @author dengqiang
     * @since 2019/9/17
     */
    @GetMapping(value = "/brand/getIdListByCondition")
    RestResultResponse<VehicleVO> getIdListByCondition(@RequestParam("searchCondition") String searchCondition);

    /**
     * 根据配置代码查询页面模板配置信息
     *
     * @param confCode
     * @return com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse<com.yonyou.cyxdms.basedata.client.domains.vo.PageTemplateConfVO>
     * @author renwd
     * @since 2019/9/24
     */
    @GetMapping(value = "/pageTemplateConfs/{confCode}")
    RestResultResponse<List<PageTemplateConfVO>> listPageTemplateConfByConfCode(@PathVariable(value = "confCode") Integer confCode);

    /**
     * 根据配置代码查询页面模板配置信息(没有登录信息)
     *
     * @param confCode  配置code
     * @param appId     appId
     * @param ownerCode ownerCode
     * @return com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse<java.util.List < com.yonyou.cyxdms.basedata.client.domains.vo.PageTemplateConfVO>>
     * @author renwd
     * @since 2019/10/8
     */
    @GetMapping(value = "/pageTemplateConfs/listPageTemplateConfWithoutLoginInfo")
    RestResultResponse<List<PageTemplateConfVO>> listPageTemplateConfWithoutLoginInfo(@RequestParam("confCode") Integer confCode, @RequestParam("appId") String appId, @RequestParam("ownerCode") String ownerCode);

    /**
     * 根据短信id查询短信信息
     *
     * @param smsTemplateId 短信id
     * @return com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse<com.yonyou.cyxdms.basedata.client.domains.vo.SmsTemplateVO>
     * @author renwd
     * @since 2019/9/25
     */
    @GetMapping(value = "/smsTemplate/getSmsTemplate")
    RestResultResponse<SmsTemplateVO> getSmsInfoById(@RequestParam("smsTemplateId") Long smsTemplateId);

    /**
     * 根据问卷id查询问卷信息
     *
     * @param questionaireId 问卷id
     * @return com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse<com.yonyou.cyxdms.basedata.client.domains.vo.QuestionaireVO>
     * @author renwd
     * @since 2019/9/25
     */
    @GetMapping(value = "/questionnaire/getQuestionnaireById")
    RestResultResponse<QuestionaireVO> getQuestionaireById(@RequestParam("questionaireId") Long questionaireId);


    /**
     * 根据questionIdList，questionnaireId查询问卷信息列表
     *
     * @param questionIdList
     * @param questionnaireId
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.entity.questionaire.CareQuestionVO>
     * @author dengqinag
     * @since 2019/10/11
     */
    @GetMapping("/questionnaire/queryQuestionByCondition")
    RestResultResponse<List<CareQuestionVO>> queryQuestionByCondition(@RequestParam Map<String, Object> queryParam);


    /**
     * 根据answerGroupId查询答案列表
     *
     * @param answerGroupId
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.questionaire.AnswerVO>
     * @author dengqiang
     * @since 2019/10/13
     */
    @GetMapping("/questionnaire/queryAnswerList")
    public RestResultResponse<List<AnswerVO>> queryAnswerList(@RequestParam("answerGroupId") Long answerGroupId);

    /**
     * ID查CODE
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/10/16
     */
    @GetMapping("/code/queryById")
    public RestResultResponse<CodeVO> queryById(@RequestParam("Id") Long id);

    /**
     * 根据id查询意向类基础信息
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/10/17
     */
    @GetMapping("/api/brand/carbrand/queryBrandRelatedData")
    public RestResultResponse<Map<String, Object>> queryBrandRelatedData(
            @RequestParam(value = "brandId", required = false) Long brandId,
            @RequestParam(value = "modelId", required = false) Long modelId,
            @RequestParam(value = "seriesId", required = false) Long seriesId,
            @RequestParam(value = "packageId", required = false) Long packageId);

    /**
     * 根据id查询省市基础信息
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/10/17
     */
    @GetMapping("/region/getProvinceRelatedData")
    public RestResultResponse<List<RegionVO>> getProvinceRelatedData(@RequestParam("ids") List<Long> ids);

    /**
     *
     * @param vehicleInfoDTO
     * @return
     */
    @GetMapping("/vsProduct/getVehicleInfoByName")
    RestResultResponse<VehicleInfoVO> getVehicleInfoByName(VehicleInfoDTO vehicleInfoDTO);

    /**
     * 根据CODENAME查询CODEID
     *
     * @author ysj
     * @date 2019/10/21
     * @param codeName
     * @return
     */
    @GetMapping("/code/getTcCodeByName")
    RestResultResponse<CodeVO> getCodeVOByName(@RequestParam("codeName") String codeName,@RequestParam("type")Integer type);

    /**
     * 通过产品代码查出productIds
     *
     * @param productCode
     * @return java.util.List<java.lang.Long>
     * @author dengqiang
     * @since 2019/10/22
     */
    @GetMapping("/vsProduct/queryProductIdsByProductCode")
    RestResultResponse<List<Long>> queryProductIdsBy(@RequestParam("productCode") String productCode);

    /**
     * 通用根据城市名称查询省市区ID列表
     *
     * @param
     * @return java.util.List<java.lang.Long>
     * @author dengqiang
     * @since 2019/10/31
     */
    @PostMapping("/region/getRegionIdList")
    RestResultResponse<List<Long>> getRegionIdList(RegionConditionDTO regionConditionDTO);


    /**
     * 根据codeId查询
     *
     * @param codeId
     * @param appId
     * @return com.yonyou.cyxdms.basedata.client.domains.vo.CodeVO
     * @author dengqiang
     * @since 2019/11/1
     */
    @GetMapping("/code/queryByCodeId")
    public RestResultResponse<CodeVO> queryByCodeId(@RequestParam("codeId") Long codeId,@RequestParam("appId") String appId);


    /**
     * 未登陆获取所有品牌
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    @GetMapping("/brand/getAllBrandByAppId")
    public RestResultResponse<List<BrandCacheVO>> getAllBrandByAppId(@RequestParam("appId") String appId);


    /**
     * 未登陆获取所有车系
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    @GetMapping("/series/getAllSeriesByAppId")
    public RestResultResponse<List<SeriesCacheVO>> getAllSeriesByAppId(@RequestParam("appId") String appId);

    /**
     * 获取所有车型
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    @GetMapping("/model/getAllModelByAppId")
    public RestResultResponse<List<ModelCacheVO>> getAllModelByAppId(@RequestParam("appId") String appId);

    /**
     * 获取配置
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    @GetMapping("/package/getAllPackageByAppId")
    public RestResultResponse<List<PackageCacheVO>> getAllPackageByAppId(@RequestParam("appId") String appId);

    /**
     * 获取所有内外饰颜色
     *
     * @param colorType 内外饰CODE
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    @GetMapping("/color/getAllColorByAppIdAndType")
    public RestResultResponse<List<ColorCacheVO>> getAllColorByAppIdAndType(@RequestParam("appId") String appId,
                                                                            @RequestParam(value = "colorType",
                                                                                    required = false) Integer colorType);

    /**
     * 通过名称和级别匹配ID
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    @GetMapping("/region/mappingRegionName")
    public RestResultResponse<RegionVO> mappingRegionName(@RequestParam("regionType") Integer regionType,
                                                          @RequestParam("regionName") String regionName,
                                                          @RequestParam(value = "appId") String appId,
                                                          @RequestParam("parentRegionId") Long parentId);


    @GetMapping("/region/getRegionById")
    public RestResultResponse<RegionVO> getRegionById(@RequestParam("id") Long id);


    @GetMapping("/region/getRegionByCode")
    public RestResultResponse<RegionVO> getRegionByCode(@RequestParam("code") String code,
                                                        @RequestParam("appId") String appId);

    /**
     * 根据问卷ID获取问卷列表信息
     *
     * @author ysj
     * @date 2019/11/13
     * @param questionnaireId 问卷ID
     * @return
     */
    @GetMapping("/questionnaire/queryQuestionVisitInfo")
    RestResultResponse<List<QuestionVisitInfoVO>> queryQuestionVisitInfo(@RequestParam("questionnaireId") Long questionnaireId);
    /**
     * 未登陆获取REGION信息
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/4
     */
    @GetMapping("/region/getAllRegion")
    RestResultResponse<List<RegionVO>> getAllRegion(@RequestParam("appId") String appid);

    /**
     * 根据code获取基础数据
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/11/15
     */
    @GetMapping("/api/brand/carbrand/queryBrandRelatedDataByCode")
    RestResultResponse<Map<String, Object>> queryBrandRelatedDataByCode(
            @ApiParam("品牌Code") @RequestParam(value = "brandCode",
                    required = false) String brandCode,
            @ApiParam("车型Code") @RequestParam(value = "modelCode",
                    required = false) String modelCode,
            @ApiParam("车系Code") @RequestParam(value = "seriesCode",
                    required = false) String seriesCode,
            @ApiParam("配置Code") @RequestParam(value = "packageCode",
                    required = false) String packageCode,
            @ApiParam("appId") @RequestParam(value = "appId") String appId);


    /**
     * 根据appId查询所有tc_code(pc登录)
     *
     * @param
     * @return com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse<java.util.List<com.yonyou.cyxdms.basedata.client.domains.vo.DictVO>>
     * @author dengqiang
     * @since 2019/11/15
     */
    @GetMapping("/code/allCode")
    RestResultResponse<List<DictVO>> allCode();

    /**
     * 根据appId查询全部可用字典
     *
     * @author lyz
     * @date 2021/3/8
     */
    @GetMapping("/code/allCodeAvailable")
    RestResultResponse<List<DictVO>> allCodeAvailable();

    /**
     * 通过ID或CODE批量获取车型类数据接口
     *
     * @param:
     * @return: map<目标数据标识, param>
     * @auther: tanjie
     * @since: 2019/11/15
     */
    @PostMapping("/api/brand/carbrand/queryBrandRelatedAll")
    RestResultResponse<Map<Long, IntentCarVo>> queryBrandRelatedAll(@RequestBody Map<Long, IntentCarVo> paramArr);

    /**
     * 通过ID或CODE批量获取车型类数据接口
     *
     * @param:
     * @return: map<目标数据标识, param>
     * @auther: tanjie
     * @since: 2019/11/15
     */
    @PostMapping("/api/brand/carbrand/queryBrandRelatedAllCMS")
    RestResultResponse<Map<Long, IntentCarCMSVO>> queryBrandRelatedAllCMS(@RequestBody Map<Long, IntentCarCMSVO> paramArr);


    @PostMapping("/api/brand/carbrand/queryBrandRelatedAllCMSOptimization")
    RestResultResponse<Map<String, IntentCarCMSVO>> queryBrandRelatedAllCMSOptimization(@RequestBody Map<String, IntentCarCMSVO> paramArr);

    /**
     * 时间+销售顾问Ids
     *     get销售顾问月销售目标
     * @author：chenzb
     * @since：2019-11-22
     */
    @GetMapping("/bastDataParams/consultantSalesTask/getConsultantSalesTaskList")
    RestResultResponse<List<SalesTaskSetVO>> getConsultantSalesTaskList(@RequestParam Map<String, Object> queryParam);

    /**
     * 通过车型或者配置ID获取上级ID
     *
     * @param:
     * @return: map<目标数据标识, param>
     * @auther: tanjie
     * @since: 2019/11/20
     */
    @PostMapping("/api/brand/carbrand/queryUpIntentCar")
    RestResultResponse<IntentCarVo> queryUpIntentCar(@RequestBody IntentCarVo intentCarVo);

    @GetMapping(value = "/region/listAllDataByAppId")
    RestResultResponse<List<RegionVO>> listAllDataByAppId(@RequestParam("appId") String appId);

    @GetMapping(value = "/vehicleProduct/options/all")
    RestResultResponse<List<VsOptionVO>> queryVehicleProductOption(VsOptionDTO vsOptionDTO);

    @GetMapping(value = "/vehicleProduct/productInfo/getInfo")
    RestResultResponse<List<VsProductVO>> getproductInfo(VsOptionDTO vsOptionDTO);

    /**
     * 查询整车编码信息[无分页]
     *
     * @param  vsOptionDTO
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.productinfo.VsProductVO>
     * @author caozx
     * @since 2020/12/14
     */
    @PostMapping(value = "/vehicleProduct/productInfo/getInfoList")
    RestResultResponse<List<VsProductVO>> getInfoList(VsOptionDTO vsOptionDTO);

    /**
     * 获取需求计划模板信息列表
     *
     * @param productCodes 产品代码
     * @author lyz
     * @date 2020/11/10
     */
    @PostMapping("/vsProduct/getPlanTemplates")
    RestResultResponse<List<PlanTemplateDTO>> getPlanTemplates(@RequestParam("productCodes") List<String> productCodes);

    /**
     * 产品导入获取产品信息
     *
     * @param productCode 产品代码
     * @author zjy
     * @date 2021/01/20
     */
    @GetMapping("/productGroup/selectByProductCode")
    RestResultResponse<VsProductDlrVO> selectByProductCode(@RequestParam("productCode")String productCode,
                                                           @RequestParam("dealerCode") String dealerCode,
                                                           @RequestParam("powerType")Integer powerType,
                                                           @RequestParam("appId")String appId);




    /**
     * CmsApp04接口
     *
     * @param cmsApp04QueryDto 查询条件
     * @author  xyy
     * @date  2021/01/19
     */
    @PostMapping("/vsProduct/searchCmsApp04Data")
    RestResultResponse<CmsApp04> searchCmsApp04Data(CmsApp04QueryDto cmsApp04QueryDto) ;

    /**
     * 获取产品信息
     *
     * @param productCode
     * @return com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse<java.util.List<com.yonyou.cyxdms.basedata.client.domains.vo.VsProductVO>>
     * @author caozx
     * @since 2021/01/28
     */
    @PostMapping(value = "/vehicleProduct/productInfo/getProduct")
    RestResultResponse<VsProductVO> getProduct(@RequestParam("productCode")String productCode);

    /**
     * 获取产品信息
     *
     * @param productCode
     * @return com.yonyou.cyx.framework.bean.dto.framework.RestResultResponse<java.util.List<com.yonyou.cyxdms.basedata.client.domains.vo.VsProductVO>>
     * @author caozx
     * @since 2021/02/22
     */
    @GetMapping(value = "/vehicleProduct/productInfo/getProductNew")
    RestResultResponse<VsProductDlrVO> getProductNew(@RequestParam("productCode")String productCode);


    @PostMapping(value = "/vehicleProduct/options/allNewQuery")
    RestResultResponse<List<VsOptionVO>> queryVehicleProductOptionallNewQuery(VsOptionDTO vsOptionDTO);


    @GetMapping(value = "/model/getModelNew")
    RestResultResponse<VsProductDlrVO> getModelNew(@RequestParam("modelCode")String modelCode,@RequestParam("appId")String appId);

}
